package iterator;

public class BookIterator implements Iterator<Book>{
    private int current;
    private BookShelf bookShelf;

    public BookIterator(BookShelf bookShelf) {
        this.current = 0;
        this.bookShelf = bookShelf;
    }

    @Override
    public boolean hasNext() {
        return current < this.bookShelf.size() ? true : false;
    }

    @Override
    public Book next() {
        return this.bookShelf.get(current++);
    }
}
